import axiosInstance from '@/api/axiosInstance'
interface commissionListParams {
  stat_month?: string
  doctor_name?: string
  docotor_code?: string
  page?: number
  pageSize?: number
  // 其他查询条件...
}

// 获取佣金等级列表
export const getCommissionList = async (params?: commissionListParams) => {
  return axiosInstance.get('/admin/monthly-commission', { params })
}

// 获取佣金等级详情
export const getCommissionDetail = async (id: number) => {
  return axiosInstance.get(`/admin/monthly-commission/${id}`)
}

//导出佣金等级列表
export const exportCommissionList = async (params?: commissionListParams) => {
  return axiosInstance.get('/admin/monthly-commission/export', { params, responseType: 'blob', timeout: 60000 })
}

export const getDailyCommissionList = async (id: number, params?: commissionListParams) => {
  return axiosInstance.get(`/admin/monthly-commission/${id}/month-commission`, { params })
}

export const getCommissionDayDetail = async (id: number, date: string) => {
  return axiosInstance.get(`/admin/monthly-commission/${id}/month-commission/${date}`)
}

export const getCommissionDayInvoices = async (id: number, date: string, params?: commissionListParams) => {
  return axiosInstance.get(`/admin/monthly-commission/${id}/month-commission/${date}/invoices`)
}

export const getConsultCommissionList = async (id: number) => {
  return axiosInstance.get(`/admin/monthly-commission/${id}/month-service-commission`)
}
